

 
 
 
  // 倒计时
  function getTime(){
          // 目标时间
          var targetTime=new Date("2021-4-30 12:00:00")
          // 当前时间
          var nowtime=new Date()
           total = parseInt((targetTime.getTime() - nowtime.getTime()) / 1000);
          // console.log(total)
          var hours = parseInt(total / 3600)
          var minutes = parseInt((total - hours * 3600) / 60)
          var seconds = total % 60
          var hours = hours < 10 ? "0" + hours : hours;
          var minutes = minutes < 10 ? "0" + minutes : minutes;
          var seconds = seconds < 10 ? "0" + seconds : seconds;
          time1.innerHTML = hours 
          time2.innerHTML=minutes
          time3.innerHTML=seconds
         
      }
      getTime()
      let jishi=setInterval(function(){
          getTime()
          // console.log(total);
          if(total<=0){
          // console.log(1);
              clearInterval(jishi)
          }
         
      },1000)
    
      